# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Container.V1.Model.NodePoolAutoscaling do
  @moduledoc """
  NodePoolAutoscaling contains information required by cluster autoscaler to adjust the size of the node pool to the current cluster usage.

  ## Attributes

  *   `autoprovisioned` (*type:* `boolean()`, *default:* `nil`) - Can this node pool be deleted automatically.
  *   `enabled` (*type:* `boolean()`, *default:* `nil`) - Is autoscaling enabled for this node pool.
  *   `locationPolicy` (*type:* `String.t`, *default:* `nil`) - Location policy used when scaling up a nodepool.
  *   `maxNodeCount` (*type:* `integer()`, *default:* `nil`) - Maximum number of nodes for one location in the node pool. Must be >= min_node_count. There has to be enough quota to scale up the cluster.
  *   `minNodeCount` (*type:* `integer()`, *default:* `nil`) - Minimum number of nodes for one location in the node pool. Must be greater than or equal to 0 and less than or equal to max_node_count.
  *   `totalMaxNodeCount` (*type:* `integer()`, *default:* `nil`) - Maximum number of nodes in the node pool. Must be greater than or equal to total_min_node_count. There has to be enough quota to scale up the cluster. The total_*_node_count fields are mutually exclusive with the *_node_count fields.
  *   `totalMinNodeCount` (*type:* `integer()`, *default:* `nil`) - Minimum number of nodes in the node pool. Must be greater than or equal to 0 and less than or equal to total_max_node_count. The total_*_node_count fields are mutually exclusive with the *_node_count fields.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :autoprovisioned => boolean() | nil,
          :enabled => boolean() | nil,
          :locationPolicy => String.t() | nil,
          :maxNodeCount => integer() | nil,
          :minNodeCount => integer() | nil,
          :totalMaxNodeCount => integer() | nil,
          :totalMinNodeCount => integer() | nil
        }

  field(:autoprovisioned)
  field(:enabled)
  field(:locationPolicy)
  field(:maxNodeCount)
  field(:minNodeCount)
  field(:totalMaxNodeCount)
  field(:totalMinNodeCount)
end

defimpl Poison.Decoder, for: GoogleApi.Container.V1.Model.NodePoolAutoscaling do
  def decode(value, options) do
    GoogleApi.Container.V1.Model.NodePoolAutoscaling.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Container.V1.Model.NodePoolAutoscaling do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
